<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('培训经历')"/>
    <th:block th:include="include :: layout-latest-css"/>
    <th:block th:include="include :: ztree-css"/>
    <th:block th:include="include :: select2-css"/>
</head>
<body class="gray-bg">
<div class="ui-layout-center">
    <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse">
                <form id="user-form">
                    <div class="select-list">
                        <ul>
                            <li>
                                姓名：<input type="text" name="name"/>
                            </li>
                            <li>
                                工号：<input type="text" name="badge"/>
                            </li>
                            <li>
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i
                                        class="fa fa-search"></i>&nbsp;搜索</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i
                                        class="fa fa-refresh"></i>&nbsp;重置</a>
                            </li>
                        </ul>
                    </div>
                </form>
            </div>

            <div class="btn-group-sm" id="toolbar" role="group">
                <a class="btn btn-success" onclick="$.operate.add()">
                    <i class="fa fa-plus"></i> 新增
                </a>
                <a class="btn btn-primary single" onclick="$.operate.edit()">
                    <i class="fa fa-edit"></i> 修改
                </a>
                <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()">
                    <i class="fa fa-remove"></i> 删除
                </a>
            </div>

            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
</div>

<th:block th:include="include :: footer"/>
<th:block th:include="include :: layout-latest-js"/>
<th:block th:include="include :: ztree-js"/>

<script th:inline="javascript">
    var prefix = ctx + "bgInfo/train";
    $(function () {
        var panehHidden = false;
        if ($(this).width() < 800) {
            panehHidden = true;
        }
        $('body').layout({initClosed: panehHidden, west__size: 350});
        queryData();
    });

    function queryData() {
        var columns = [];
        var checkbox = {checkbox: true};
        var id = {field: 'id', title: '序号'};
        var badge = {field: 'badge', title: '工号'};
        var name = {field: 'name', title: '姓名'};
        var compName = {field: 'compName', title: '公司名称'};
        var depName = {field: 'depName', title: '部门名称'};
        var jobName = {field: 'jobName', title: '工作岗位'};
        var IsJoin = {title: '入职前后?',
            formatter: function (value, row, index) {
                if(row.IsJoin == 0){
                    return '前'
                }else if(row.IsJoin == 1){
                    return '后'
                }
            }
        };
        var TrainTypeTitle = {field: 'TrainTypeTitle', title: '培训类型'};
        var TrainKindTitle = {field: 'TrainKindTitle', title: '培训形式'};
        var Content = {field: 'Content', title: '培训主题'};
        var Course = {field: 'Course', title: '培训课程'};
        var BeginDate = {field: 'BeginDate', title: '开始时间'};
        var EndDate = {field: 'EndDate', title: '结束时间'};
        var Vendor = {field: 'Vendor', title: '举办机构'};
        var Place = {field: 'Place', title: '培训地点'};
        var Hours = {field: 'Hours', title: '课时'};
        var Certificate = {field: 'Certificate', title: '所获证书'};
        var CertificateNo = {field: 'CertificateNo', title: '证书编号'};
        var AgreementNo = {field: 'AgreementNo', title: '协议编号'};
        var Abegindate = {field: 'Abegindate', title: '协议开始日期'};
        var Aterm = {field: 'Aterm', title: '协议期'};
        var Aenddate = {field: 'Aenddate', title: '协议结束日期'};
        var Expenses = {field: 'Expenses', title: '培训费用'};

        columns.push(checkbox,id,badge,name,compName,depName,jobName,IsJoin,TrainTypeTitle,TrainKindTitle);
        columns.push(Content,Course,BeginDate,EndDate,Vendor,Place,Hours,Certificate,CertificateNo,AgreementNo);
        columns.push(Abegindate,Aterm,Aenddate,Expenses);

        var options = {
            code: "id",
            uniqueId: "id",
            url: prefix + "/findDataList",
            createUrl: prefix + "/add",
            updateUrl: prefix + "/edit/{id}",
            removeUrl: prefix + "/remove",
            detailUrl: prefix + "/detail/{id}",
            escape: true,
            showPageGo: true,
            rememberSelected: true,
            height: $(window).height() - 120,
            sortOrder: "desc",
            modalName: "培训经历",
            columns: columns
        };
        $.table.init(options);
    }


</script>
</body>
</html>